home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
-
- set -e
-
- if [ "$1" = "configure" ]
- then
- case $2 in
- 1.2-*)
- cat<<EOT
- The default behaviour of syslogd has altered from 1.2 to 1.3. By default
- *no* messages from the UDP port are accepted.
-
- Read the documentation in /usr/share/doc/sysklogd carefully. Some important
- things have been changed!
-
- Press [Enter] to continue
- EOT
- read xyz
- ;;
- esac
- fi
-
- if [ "$1" = "configure" ]
- then
-
- # Prepare for takeover of the host
- if [ -z "$2" ]
- then
- if [ ! -e /var/log/news ] \
- && grep -q '^[^#].*/var/log/news/' /etc/syslog.conf \
- && grep -q ^news: /etc/passwd \
- && grep -q ^news: /etc/group
- then
- mkdir /var/log/news
- chmod 2755 /var/log/news
- chown news:news /var/log/news
- fi
-
- # Create logfiles with correct file modes
- if [ -z "$2" ]
- then
- for LOG in `syslogd-listfiles --all`
- do
- if [ ! -f $LOG ]
- then
- touch $LOG
- fi
- chown root:adm $LOG
- chmod 640 $LOG
- done
- fi
- fi
-
- if [ -f /etc/init.d/sysklogd -a -n "$2" ]
- then
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]
- then
- invoke-rc.d sysklogd stop
- else
- sh /etc/init.d/sysklogd stop
- fi
- set -e
- fi
-
- update-rc.d sysklogd multiuser 10 90 >/dev/null
-
- # Remove shutdown and reboot links; this init script does not need them.
- if dpkg --compare-versions "$2" lt "1.4.1-18ubuntu2"; then
- rm -f /etc/rc0.d/K90sysklogd /etc/rc6.d/K90sysklogd
- fi
-
- adduser --system --group --no-create-home --quiet syslog
-
- # restarting daemon
- #
- if [ -f /etc/init.d/sysklogd ]
- then
- set +e
- if [ -x /usr/sbin/invoke-rc.d ]
- then
- invoke-rc.d sysklogd start
- else
- sh /etc/init.d/sysklogd start
- fi
- set -e
- fi
- fi
-
- exit 0
-